#pragma once
#include <functional>



namespace mgl{
    using namespace std;
    struct wfun{
        wfun(function<double(double)> f):m_f(f){}
        double operator()(double x){
            return m_f(x);
        }
        static double wrapfun(double x, void *para){
            wfun * p = static_cast<wfun*>(para);
            return (*p)(x);
        }
        function<double(double)> m_f;
    };
}
